﻿using Enyim.Caching;
using Ayatta.Contract;
using Newtonsoft.Json;
using System.Web.Mvc;
using Web.Base.Controllers;

namespace Web.Product.Upload.Controllers
{
    public class CategoryController : BaseController
    {
        public CategoryController(ILogService logService, IBaseService baseService, IExtraService extraService, IStoreService storeService, IOrderService orderService, IGameService gameService, IAuctionService auctionService, IPassportService passportService, IPaymentService paymentService, IMemcachedClient memcachedClient)
            : base(logService, baseService, extraService, storeService, orderService, gameService, auctionService, passportService, paymentService, memcachedClient)
        {
        }
        [HttpPost]
        public ActionResult Index(int param = 0)
        {
            var categories = GetCategories(param);
            var json = JsonConvert.SerializeObject(categories);
            return Content(json, "application/json");
        }
        [HttpPost]
        public ActionResult Prop(int param = 0)
        {
            var props = GetProps(param);
            var propValues = GetPropValues(param);
            var data = new { Props = props, PropValues = propValues };
            var json = JsonConvert.SerializeObject(data);
            return Content(json, "application/json");
        }
    }
}
